import fetch from 'utils/fetch';
// 分页
export function getAllRole(query) {
  return fetch({
    url: '/api/admin/group/pri/getAllRole',
    method: 'get',
    params: query
  });
}
// 添加角色
export function addRole(obj) {
  return fetch({
    url: '/api/admin/group/pri/addRole',
    method: 'post',
    data: obj
  });
}
// 编辑角色
export function updateRole(obj) {
  return fetch({
    url: '/api/admin/group/updateRole',
    method: 'put',
    data: obj
  });
}
// 删除角色
export function deleteRole(obj) {
  return fetch({
    url: '/api/admin/group/deleteRole',
    method: 'delete',
    data: obj
  })
}
// 菜单回显
export function getChannelTree() {
  return fetch({
    url: '/api/admin/menu/pri/getChannelTree',
    method: 'get'
  })
}
// 启用禁用
export function startUpAndDown(obj) {
  return fetch({
    url: '/api/admin/group/startUpAndDown',
    method: 'put',
    data: obj
  });
}
// 编辑回显树
export function getEditChannelTree(query) {
  return fetch({
    url: '/api/admin/menu/pri/getEditChannelTree',
    method: 'get',
    params: query
  });
}
